home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / bin / spray (.txt) < prev    next >
Microsoft Windows Help File Content  |  1995-08-01  |  7KB  |  186 lines

  1. # spray - script to create necessary symbolic links in /usr/lib/X11
  2. #         and /usr/skunk in order to be able to run the software provided
  3. #         on the SCO Skunkware CD-ROM
  4. # Written 09-Mar-94 by rr@sco.com
  5. # Usage : spray <mount-point>
  6. #         Where <mount-point> is the directory on which the CD-ROM is mounted
  7. #         If mounted on /usr/skunk, no argument is necessary
  8. usage() {
  9.     echo "Usage: spray [mount-point]"
  10.     echo "\tWhere mount-point refers to the directory on which"
  11.     echo "\tthe CD-ROM is mounted. If no arguments are given, it"
  12.     echo "\tis assumed the CD-ROM is mounted on /usr/skunk."
  13.     exit 1
  14. getyn() {
  15.     ans=
  16.     while [ "$ans" = "" ]
  17.         read ans
  18.         [ "$ans" = "Y" ] || [ "$ans" = "y" ] && {
  19.             ans=Y
  20.             break
  21.         [ "$ans" = "n" ] || [ "$ans" = "N" ] && {
  22.             ans=N
  23.             break
  24.         ans=
  25.         echo "\nPlease answer with a Y or N \c"
  26.     done
  27. [ $# = 0 ] && MOUNT_PT=/usr/skunk
  28. [ $# = 1 ] && MOUNT_PT=$1
  29. [ $# -gt 1 ] && usage
  30. # check to see if the user has root privelege
  31. fuid=`id`
  32. uid=`echo $fuid | awk ' { print $1 } '`
  33. [ "$uid" = "uid=0(root)" ] || {
  34.     echo "You must have root priveleges to run spray."
  35.     usage
  36.     exit 1
  37. # check to make sure the cd is mounted and what we expect is there
  38. [ -f $MOUNT_PT/pics/README ] || usage
  39. [ -d $MOUNT_PT/lib/X11/app-defaults ] || usage
  40. APPDEFDIR=/usr/lib/X11/app-defaults
  41. SKUNKLIST="README RELEASE.NOTES \
  42.     audio bin cdmt etc games include info lib man pics \
  43.     src tls usr xc"
  44. # set up the X11 app-defaults directory
  45. [ -d $APPDEFDIR ] || mkdir -p $APPDEFDIR
  46. cd $APPDEFDIR
  47. for i in $MOUNT_PT/lib/X11/app-defaults/*
  48.     [ "$i" = "$MOUNT_PT/lib/X11/app-defaults/XMcd" ] && continue
  49.     [ -r `basename $i` ] || ln -s $i .
  50. # set up the Willow directory
  51. WILLOW_DIR=lib/X11/willow
  52. [ -d /usr/$WILLOW_DIR ] || {
  53.     [ -h /usr/$WILLOW_DIR ] || ln -s $MOUNT_PT/$WILLOW_DIR /usr/$WILLOW_DIR
  54. # set up the Periodic uid file
  55. UID_DIR=lib/X11/uid
  56. UIDFILE=$UID_DIR/periodic.uid
  57. [ -f /usr/$UIDFILE ] || {
  58.     [ -d /usr/$UID_DIR ] || mkdir -p /usr/$UID_DIR
  59.     ln -s $MOUNT_PT/$UIDFILE /usr/$UIDFILE
  60. # set up directory links in /usr/local/lib (for now)
  61. [ -d /usr/local/lib ] || {
  62.     mkdir -p /usr/local/lib
  63. [ -d /usr/local/lib/xboing ] || {
  64.     mkdir -p /usr/local/lib/xboing
  65. LOCALLIBDIRS="gcc-lib povray sc-6.21 xboing/levels xc xconq mosaic lynx \
  66.     X11"
  67. LOCALLIBFILS="libg++.a"
  68. for i in $LOCALLIBDIRS
  69.     [ -d /usr/local/lib/$i ] || ln -s $MOUNT_PT/lib/$i /usr/local/lib/$i
  70. for i in $LOCALLIBFILS
  71.     [ -f /usr/local/lib/$i ] || ln -s $MOUNT_PT/lib/$i /usr/local/lib/$i
  72. # Now setup the Fresco DLL's so you don't need to modify LD_LIBRARY_PATH
  73. cd /usr/lib
  74. for i in $MOUNT_PT/lib/*.so $MOUNT_PT/lib/*.so.1.0
  75.     ln -s $i .
  76. # Setup the Flying directory in /usr/games
  77. FLYINGDIR=/usr/games/lib/flying-6.11/fly.dta
  78. [ -d $FLYINGDIR ] || [ -h $FLYINGDIR ] || mkdir -p $FLYINGDIR
  79. [ -d $FLYINGDIR ] && chmod 777 $FLYINGDIR
  80. touch $FLYINGDIR/logfile.txt
  81. chmod a+r $FLYINGDIR/logfile.txt
  82. # Setup the various scorefiles in usr/games and /usr/local
  83. [ -d /usr/games/lib ] || mkdir -p /usr/games/lib
  84. [ -f /usr/games/lib/spatial.sco ] || {
  85.     cp $MOUNT_PT/games/lib/spatial.sco /usr/games/lib/spatial.sco
  86.     chmod 666 /usr/games/lib/spatial.sco
  87. XBDIR=/usr/local/lib/xboing
  88. [ -d $XBDIR ] || mkdir -p $XBDIR
  89. [ -f $XBDIR/xboing.scores ] || {
  90.     cp $MOUNT_PT/lib/xboing/xboing.scores $XBDIR/xboing.scores
  91.     chmod 666 $XBDIR/xboing.scores
  92. [ -f /usr/games/lib/xtetris-scores ] || {
  93.     cp $MOUNT_PT/games/lib/xtetris-scores /usr/games/lib/xtetris-scores
  94.     chmod 666 /usr/games/lib/xtetris-scores
  95. [ -f /usr/games/lib/mosaic.scores ] || {
  96.     cp $MOUNT_PT/games/lib/mosaic.scores /usr/games/lib/mosaic.scores
  97.     chmod 666 /usr/games/lib/mosaic.scores
  98. # Setup the Nethack directory in /usr/games
  99. NETHACKDIR=/usr/games/lib/nethackdir
  100. HACKIT=1
  101. [ -d $NETHACKDIR ] || {
  102.     if [ -h $NETHACKDIR ]
  103.     then
  104.         echo "It looks like $NETHACKDIR is a symlink."
  105.         echo "I will leave it up to you to configure this directory."
  106.         HACKIT=
  107.     else
  108.         mkdir -p $NETHACKDIR
  109. [ "$HACKIT" ] && {
  110.     chmod 777 $NETHACKDIR
  111.     cd $NETHACKDIR
  112.     for i in $MOUNT_PT/games/lib/nethackdir/*
  113.         name=`basename $i`
  114.         [ -h $name ] || [ -f $name ] || ln -s $i .
  115.     done
  116.     ls -l perm | grep $MOUNT_PT > /dev/null && {
  117.         rm -f perm
  118.         touch perm
  119.         chmod 666 perm
  120.     ls -l logfile | grep $MOUNT_PT > /dev/null && {
  121.         rm -f logfile
  122.         touch logfile
  123.         chmod 666 logfile
  124.     ls -l record | grep $MOUNT_PT > /dev/null && {
  125.         rm -f record
  126.         touch record
  127.         chmod 666 record
  128.     ls -l save | grep $MOUNT_PT > /dev/null && {
  129.         rm -f save
  130.         mkdir save
  131.         chmod 777 save
  132. [ "$MOUNT_PT" = "/usr/skunk" ] || {
  133.     if [ -d /usr/skunk ]
  134.     then
  135.       for foo in $SKUNKLIST
  136.       do
  137.         if [ -d /usr/skunk/$foo ]
  138.         then
  139.         # /usr/skunk/$foo is a directory for some reason so we cd there
  140.         # and try to create symbolic links out to the mount point
  141.             cd /usr/skunk/$foo
  142.             for i in $MOUNT_PT/$foo/*
  143.             do
  144.                 [ -r `basename $i` ] || ln -s $i .
  145.             done
  146.         elif [ -h /usr/skunk/$foo ]
  147.         then
  148.         # /usr/skunk/$foo is a symbolic link to a previous mount point
  149.         # so we remove it and re-link it
  150.             rm -f /usr/skunk/$foo
  151.             ln -s $MOUNT_PT/$foo /usr/skunk/$foo
  152.         else
  153.         # /usr/skunk/$foo is neither a symbolic link or directory so
  154.         # let's just try to make it a symbolic link to the mount point
  155.             rm -f /usr/skunk/$foo
  156.             ln -s $MOUNT_PT/$foo /usr/skunk/$foo
  157.       done
  158.     else
  159.         rm -f /usr/skunk
  160.         ln -s $MOUNT_PT /usr/skunk
  161. echo "\nInitial SCO Skunkware configuration complete.\n"
  162. echo "Some SCO Skunkware files need to be copied to the hard disk"
  163. echo "in order to function properly. Others need to be setuid/setgid."
  164. echo "Would you like to perform this additional setup at this time ? <Y/N> \c"
  165. getyn
  166. if [ "$ans" = "Y" ] 
  167.     /usr/skunk/bin/sprinkle -m $MOUNT_PT
  168.     echo "\nThe additional configuration necessary for some SCO Skunkware"
  169.     echo "components can be performed later by running (as root) the command :"
  170.     echo "\n\t/usr/skunk/bin/sprinkle\n"
  171. echo "\nSCO Skunkware 5 contains both the NCSA Mosaic graphical web browser"
  172. echo "and Lynx, a character mode web browser. A wealth of information"
  173. echo "about Skunkware components is available via these browsers. I have"
  174. echo "temporarily set your PATH for browser use. See the RELEASE.NOTES for"
  175. echo "instructions on how to take full advantage of these documents."
  176. echo "\nWould you like to browse the SCO Skunkware 5 CD-ROM ? <Y/N> \c"
  177. getyn
  178. if [ "$ans" = "Y" ] 
  179.     echo "\nStarting the SCO Skunkware 5 prowl program."
  180.     echo "Please wait while i load the pages ...\c"
  181.     /usr/skunk/bin/prowl -s
  182.     echo "\nThe SCO Skunkware 5 CD-ROM can be browsed at your convenience"
  183.     echo "by running the command :"
  184.     echo "\n\t/usr/skunk/bin/prowl\n"
  185. exit 0
  186.